<?php 
class CErrorMessage {

	protected $m_arrstrErrorMessages;
	protected $m_arrstrSuccessMessages;
			
	public function __construct() {
		return true;
	}	

	/**************************************
	************* SET FUNCTIONS ***********
	**************************************/
	
	public function setErrorMessage( $strErrorMessage ) {
		$this->m_arrstrErrorMessages[] = $strErrorMessage; 
		$_SESSION['error_messages'] = $this->m_arrstrErrorMessages;
	}
		
	public function setErrorMessages( $arrstrErrorMessages ) {

		if( true == valArr( $arrstrErrorMessages ) ) {
			foreach( $arrstrErrorMessages as $strErrorMessage ) {
				$this->setErrorMessage( $strErrorMessage );
			}
		}
	}
	
	public function setSuccessMessage( $strSuccessMessage ) {
		$this->m_arrstrSuccessMessages[] = $strSuccessMessage;
		$_SESSION['success_messages'] = $this->m_arrstrSuccessMessages;
	}
	
	public function setSuccessMessages( $arrstrsuccessMessages ) {
	
		if( true == valArr( $arrstrsuccessMessages ) ) {
			foreach( $arrstrsuccessMessages as $strSuccessMessage ) {
				$this->setSuccessMessage( $strSuccessMessage );
			}
		}
	}
	
	/**************************************
	************* GET FUNCTIONS ***********
	**************************************/
	

	public function getErrorMessages() {
		return $this->m_arrstrErrorMessages;
	}
	
	public function getSuccessMessages() {
		return $this->m_arrstrSuccessMessages;
	}
	
}
?>